package day1104.demo04;

import java.util.function.Function;
import java.util.function.Supplier;

/**
 * @author wql
 * @version 1.0
 * @date 2022/11/4 15:50
 */

public class Test {
    public static void main(String[] args) {
        //有参构造
       Function<String ,Wql> function=t->new Wql(t);
        Function<String ,Wql> function1=Wql::new;
        System.out.println(function1.apply("hahahahah"));

        //无参构造
        Supplier<Wql> supplier=()->new Wql();
        System.out.println(supplier.get());
    }
}
class Wql{
    private String adress;

    public Wql(){

    }
    public Wql(String adress) {
        this.adress = adress;
    }

    public String getAdress() {
        return adress;
    }

    public void setAdress(String adress) {
        this.adress = adress;
    }

    @Override
    public String toString() {
        return "Wql{" +
                "adress='" + adress + '\'' +
                '}';
    }
}
